package com.pc.service.impl;

import com.pc.enrty.Order;
import com.pc.enrty.Orderitems;
import com.pc.mapper.OrderItemsMapper;
import com.pc.pojo.OrderitemsAndOrderAndFood;
import com.pc.mapper.OrderItemsMapper;
import com.pc.mapper.OrderMapper;
import com.pc.pojo.OrderitemsAndOrderAndFood;
import com.pc.mapper.OrderItemsMapper;
import com.pc.mapper.OrderMapper;
import com.pc.service.OrderItemsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;

@Service
@SuppressWarnings("All")
public class OrderItemsServiceImpl implements OrderItemsService {
    @Autowired
    private OrderItemsMapper orderItemsMapper;


    @Autowired
    private OrderMapper orderMapper;

    @Override
    public ArrayList<Orderitems> findOrderitems(Orderitems orderitems) {
        return null;
    }

    @Override
    public boolean addOrderItems(Orderitems orderItems) {
        return orderItemsMapper.insertOrderItems(orderItems)>0?true:false;
    }

    @Override
    public boolean removeOrderItems(Orderitems orderItems) {
        return false;
    }

    @Override
    public int updateOrderItems(String ordernumber) {
        int i = orderItemsMapper.updateOrderItems(ordernumber);
        return i;
    }

    @Override
    public ArrayList<OrderitemsAndOrderAndFood> selectByUserid(Integer userid) {
        return orderItemsMapper.selectByUserid(userid);
    }

    @Override
    public ArrayList<Order> findOrder(Integer userid) {
        return orderMapper.selectByuserid(userid);
    }

  /*  @Override
    public ArrayList<OrderitemsAndOrderAndFood> selectByUserid(Integer userid) {

        ArrayList<OrderitemsAndOrderAndFood> orderitemsAndOrderAndFoods = orderItemsMapper.selectByUserid(userid);

        return orderitemsAndOrderAndFoods;

    }*/
}
